Questions 1 Write a query to display each zip code and the t

Questions 1. Write a query to display each zip code and the total owed by customers in that zip code. Only include zip codes where the total owed is above 1000.

\"SalesRep
      
SalesRep PK RepID int Customer PK CustomerID int LastName FirstName CommissionRatedecimal(10,2) varchar(20) varchar(20) LastName varchar(20) FirstName varchar(20) Street City State Zipcode Balance varchar(20) varchar(20) char(2) char(5) decimal (10,2) int Order PK OrderID int FK1 RepID FK1 CustomerlD int OrderDate date ShipDate date Part PK PartID int OrderLine Description varchar(20) UnitsOnHandint ItemClass Retail Cost PK,FK1 OrderID int int PK,FK2 PartID char(4) decimal(10,2) decimal(10,2) Quantityint

Solution

1)

select zipcode,sum(balance) from Customer where sum(balance)>1000 group by zip code

2)

select PartID,Description from Part where UnitsOnHand>(select avg(UnitsOnHand) from Part)

Questions 1. Write a query to display each zip code and the total owed by customers in that zip code. Only include zip codes where the total owed is above 1000.
Questions 1. Write a query to display each zip code and the total owed by customers in that zip code. Only include zip codes where the total owed is above 1000.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site